package com.teamcenter.rac.massupdate.validators;

import com.teamcenter.rac.massupdate.model.UpdateJobModel;
import com.teamcenter.rac.ui.commands.validators.ValidateIsObjectNotNull;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class ReplacementPartValidator
  extends ValidateIsObjectNotNull
{
  private UpdateJobModel m_updateJobModel;
  
  public ReplacementPartValidator(String paramString, UpdateJobModel paramUpdateJobModel)
  {
    super(paramString);
    this.m_updateJobModel = paramUpdateJobModel;
  }
  
  public IStatus validate(Object paramObject)
  {
    if ((this.m_updateJobModel != null) && (this.m_updateJobModel.isReplacementPartRequired())) {
      return super.validate(paramObject);
    }
    return Status.OK_STATUS;
  }
}